import axios from 'axios';
axios.defaults.withCredentials = true

export const url = `http://localhost:9090/fastFood`
export const uploadFileUrl = `${url}/fileUtils/uploadFile`
export const showUrl = url+"/images/"

//登录
export const requestLogin = params => { return axios.post(`${url}/login/login`, params).then(res => res.data) }

//用户相关
export const updateUser = params => { return axios.post(`${url}/user/updateUser`, params).then(res => res.data) }
export const delUser = params => { return axios.post(`${url}/user/delUser`, params).then(res => res.data) }
export const queryUser = params => { return axios.post(`${url}/user/queryUser`, params).then(res => res.data) }
export const queryUserByPage = params => { return axios.post(`${url}/user/queryUserByPage`, params).then(res => res.data) }
export const queryUserById = params => { return axios.post(`${url}/user/queryUserById`, params).then(res => res.data) }
export const queryUserSalaryByPage = params => { return axios.post(`${url}/user/queryUserSalaryByPage`, params).then(res => res.data) }

//菜品相关
export const updateFood = params => { return axios.post(`${url}/food/updateFood`, params).then(res => res.data) }
export const delFood = params => { return axios.post(`${url}/food/delFood`, params).then(res => res.data) }
export const queryFood = params => { return axios.post(`${url}/food/queryFood`, params).then(res => res.data) }
export const queryFoodByPage = params => { return axios.post(`${url}/food/queryFoodByPage`, params).then(res => res.data) }
export const queryFoodById = params => { return axios.post(`${url}/food/queryFoodById`, params).then(res => res.data) }

//库存
export const updateMaterial = params => { return axios.post(`${url}/material/updateMaterial`, params).then(res => res.data) }
export const delMaterial = params => { return axios.post(`${url}/material/delMaterial`, params).then(res => res.data) }
export const queryMaterial = params => { return axios.post(`${url}/material/queryMaterial`, params).then(res => res.data) }
export const queryMaterialByPage = params => { return axios.post(`${url}/material/queryMaterialByPage`, params).then(res => res.data) }
export const queryMaterialById = params => { return axios.post(`${url}/material/queryMaterialById`, params).then(res => res.data) }

//库存记录
export const updateMaterialLog = params => { return axios.post(`${url}/materialLog/updateMaterialLog`, params).then(res => res.data) }
export const delMaterialLog = params => { return axios.post(`${url}/materialLog/delMaterialLog`, params).then(res => res.data) }
export const queryMaterialLog = params => { return axios.post(`${url}/materialLog/queryMaterialLog`, params).then(res => res.data) }
export const queryMaterialLogByPage = params => { return axios.post(`${url}/materialLog/queryMaterialLogByPage`, params).then(res => res.data) }
export const queryMaterialLogById = params => { return axios.post(`${url}/materialLog/queryMaterialLogById`, params).then(res => res.data) }

//订单
export const updateOrder = params => { return axios.post(`${url}/order/updateOrder`, params).then(res => res.data) }
export const delOrder = params => { return axios.post(`${url}/order/delOrder`, params).then(res => res.data) }
export const queryOrder = params => { return axios.post(`${url}/order/queryOrder`, params).then(res => res.data) }
export const queryOrderByPage = params => { return axios.post(`${url}/order/queryOrderByPage`, params).then(res => res.data) }
export const queryOrderById = params => { return axios.post(`${url}/order/queryOrderById`, params).then(res => res.data) }

//采购
export const updatePurchaseLog = params => { return axios.post(`${url}/purchaseLog/updatePurchaseLog`, params).then(res => res.data) }
export const delPurchaseLog = params => { return axios.post(`${url}/purchaseLog/delPurchaseLog`, params).then(res => res.data) }
export const queryPurchaseLog = params => { return axios.post(`${url}/purchaseLog/queryPurchaseLog`, params).then(res => res.data) }
export const queryPurchaseLogByPage = params => { return axios.post(`${url}/purchaseLog/queryPurchaseLogByPage`, params).then(res => res.data) }
export const queryPurchaseLogById = params => { return axios.post(`${url}/purchaseLog/queryPurchaseLogById`, params).then(res => res.data) }
export const updateStatus = params => { return axios.post(`${url}/purchaseLog/updateStatus`, params).then(res => res.data) }

//销售日志&绩效
export const updateSaleLog = params => { return axios.post(`${url}/saleLog/updateSaleLog`, params).then(res => res.data) }
export const delSaleLog = params => { return axios.post(`${url}/saleLog/delSaleLog`, params).then(res => res.data) }
export const querySaleLog = params => { return axios.post(`${url}/saleLog/querySaleLog`, params).then(res => res.data) }
export const querySaleLogByPage = params => { return axios.post(`${url}/saleLog/querySaleLogByPage`, params).then(res => res.data) }
export const querySaleLogById = params => { return axios.post(`${url}/saleLog/querySaleLogById`, params).then(res => res.data) }
export const billExport = params => { return axios.post(`${url}/saleLog/billExport`, params).then(res => res.data) }
export const materialStatistic = params => { return axios.post(`${url}/saleLog/materialStatistic`, params).then(res => res.data) }